#include <stdio.h>
#include <string.h>
static char *protostrings[] =
{
  "cid:",
  "clsid:",
  "file:",
  "finger:",
  "ftp:",
  "gopher:",
  "hdl:",
  "http:",
  "https:",
  "ilu:",
  "ior:",
  "irc:",
  "java:",
  "javascript:",
  "lifn:",
  "mailto:",
  "mid:",
  "news:",
  "nntp:",
  "path:",
  "prospero:",
  "rlogin:",
  "service:",
  "shttp:",
  "snews:",
  "stanf:",
  "telnet:",
  "tn3270:",
  "wais:",
  "whois++:",
  NULL
};

int has_proto(const char *url)
{
  char **s1;
  //  url += skip_url(url);
  for (s1 = protostrings;*s1;s1++) {
    if (strncasecmp(url,*s1,strlen(*s1)) == 0) {
        return 1;
    }
  }
  return 0;
}

int main(int argc,char **argv)
{
  const char *url = "http://www.google.com";
  printf("%d", has_proto(url));
  return 0;
}
